package com.mayikt;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @program: mayikt-springcloud-alibaba
 * @description
 * @author: tianya
 * @create: 2020-05-21 20:17
 **/
@SpringBootApplication
public class OrderApplication8011 {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication8011.class,args);
    }

    /**
     * 加上LoadBalanced就可使用ribbon实现本地负载均衡
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
